CC = gcc
CFLAGS = -Wall -I.

LIBS = gtk+-2.0 librsvg-2.0 cairo
CFLAG_PARAMS = `pkg-config --cflags ${LIBS}`
LIB_PARAMS = `pkg-config --libs ${LIBS}`

all: udock

udock: main.o engine_if.o
	${CC} ${CFLAGS} -o udock main.o engine_if.o ${CFLAG_PARAMS} ${LIB_PARAMS}

main.o: main.c itemengine.h engine_if.h main.h engine_if.o
	${CC} ${CFLAGS} -c main.c ${CFLAG_PARAMS} ${LIB_PARAMS}

engine_if.o: engine_if.c engine_if.h
	${CC} ${CFLAGS} -c engine_if.c ${CFLAG_PARAMS} ${LIB_PARAMS}

appstarter.o: appstarter.c itemengine.h
	${CC} ${CFLAGS} -c appstarter.c ${CFLAG_PARAMS} ${LIB_PARAMS}

appstarter: appstarter.o
	ld -shared -o appstarter.so appstarter.o

clean:
	rm udock main.o appstarter.o engine_if.o

.PHONY: clean